package L1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class _064 {
    /**
     * 估值一亿的AI核心代码
     */
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        for (int i=0;i<N;i++){
            String line = reader.readLine();
            System.out.println(line);
            char[] chars = line.toCharArray();
            String cstr="";
            for (int j=0;j<chars.length;j++){
                if (chars[j]>='A'&&chars[j]<='Z'&&chars[j]!='I'){
                    chars[j]+=32;
                }
                cstr+=chars[j];
            }
            cstr=cstr.trim();//去掉首尾多余空格
            cstr=cstr.replaceAll(" +", " ");//相邻单词间多个空格换成1个空格
            cstr=cstr.replaceAll(" (\\W)", "$1");//去掉标点符号前面的空格。标点符号默认为除了大小写英文字母和数字和下划线之外的符号。\W就是与任何非单词字符匹配
            cstr=cstr.replaceAll("\\?", "!");//将所有？替换为！
            cstr=cstr.replaceAll("\\bcan you\\b","A");//如果can you两边是非字的（即要么是空格要么是除了大小写字母和数字和下划线）就替换成A
            cstr=cstr.replaceAll("\\bcould you\\b","B");
            cstr=cstr.replaceAll("\\b(I|me)\\b","C");//如果是独立的I或者me就替换成C
            cstr=cstr.replaceAll("A","I can");
            cstr=cstr.replaceAll("B","I could");
            cstr=cstr.replaceAll("C","you");
            System.out.println("AI: "+cstr);
        }
    }
}
